<style>
#setSelectCatTable .tableform .cate1v1 {background:#99C;text-align:right;vertical-align:middle;font-weight:600;font-size:14px;color:#FFF}
</style>

<div class="tableform">
	 <h4>基础设置：</h4>
    <div class="widgetconfig division">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
			<th width="15%">显示品牌：</th>		
			<td width="35%"><input type="radio" name="showrand" value="on" <{if $setting.showrand!="off"}> checked="checked"<{/if}> >&nbsp;是&nbsp;&nbsp;<input type="radio" name="showrand" value="off" <{if $setting.showrand=="off"}> checked="checked"<{/if}>>&nbsp;否&nbsp;&nbsp;&nbsp;显示：&nbsp;<input type="text" name="maxbrands" value="<{$setting.maxbrands|default:'8'}>"  class="inputstyle" style="width:60px;">&nbsp;条</td>
            <th width="15%">品牌logo尺寸：</th>
            <td width="35%">宽：<input type="text" class="inputstyle" name="brand_width" value="<{$setting.brand_width|default:'220'}>" style="width:60px;" /> px&nbsp;&nbsp;&nbsp;高：<input type="text" class="inputstyle" name="brand_height" value="<{$setting.brand_height|default:'470'}>" style="width:60px;" /> px</td>
		</tr>	
         <tr>                
            <th width="15%">显示促销活动：</th>
         	<td width="35%"><input type="radio" name="showsales" value="on" <{if $setting.showsales!="off"}> checked="checked"<{/if}> >&nbsp;是&nbsp;&nbsp;<input type="radio" name="showsales" value="off" <{if $setting.showsales=="off"}> checked="checked"<{/if}>>&nbsp;否 &nbsp;&nbsp;&nbsp;显示：&nbsp;<input type="text" name="maxsales" value="<{$setting.maxsales|default:'5'}>" class="inputstyle" style="width:60px;">&nbsp;条</td>
            
		</tr>
         <tr>
           <th width="15%">分类链接在新窗口打开：</th>
         	<td width="35%"><input type="checkbox" name="target_blank" value="1"<{if $setting.target_blank}> checked <{/if}> />是</td>	
            <th> </th>
            <td></td>
		</tr>
		</table>
    </div>
</div>

<div class="tableform">
	<div class="clearfix" style="padding:5px 20px">
    <{button label=$___b2c="添加自定义分类栏目"|t:'b2c' app="desktop" icon="btn_add.gif" id="add_ad_pic" onclick="addCustom();"}>  （用于分类不足时填充） 
    </div>
    <div class="widgetconfig division" id="cat-custom-list">
        <{if $setting.custom}>
        <{foreach from=$setting.custom item=menu key=key}>
            <div class="custom">
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <th width="15%">标题：</th>
                        <td width="25%"><input type="text" name="custom[<{$menu.i}>][cat_name]" value="<{$menu.cat_name}>" class="inputstyle" style="width:90%" /></td>			
                        <th width="15%">链接：</th>
                        <td width="40%"><input type="text" name="custom[<{$menu.i}>][url]" value="<{$menu.url}>" class="inputstyle" style="width:90%"></td>
                        <td width="5%"><span onclick="delLink(this)" class="opt"><{img src="bundle/delecate.gif" style="cursor:pointer;" title="删除" app="desktop"}></span></td>
                    </tr>
                </table>
                <input type="hidden" name="custom[<{$menu.i}>][i]" value="<{$menu.i}>">
            </div>
        <{/foreach}>
        <{/if}>
    </div>
</div>
 
 
<script>
/*加自定义分类*/
var d=new Date();
function addCustom(){
	var content,i=d.getTime();
	content='\
		<div class="custom" style="margin-top:5px;">\
			<table width="100%" cellpadding="0" cellspacing="0">\
			  <tr>\
			  <th width="15%">标题：</th>\
			  <td width="25%"><input type="text" name="custom['+i+'][cat_name]" class="inputstyle" style="width:90%"></td>\
			  <th width="15%">链接：</th>\
			  <td width="40%"><input type="text" name="custom['+i+'][url]" class="inputstyle" style="width:90%"></td>\
			  <td width="5%"><span onclick="delLink(this)" class="opt"><{img src="bundle/delecate.gif" style="cursor:pointer;" title="删除" app="desktop"}></span</td>\
			  </tr>\
			</table>\
			<input type="hidden" name="custom['+i+'][i]" value="'+i+'">\
		</div>\
	';
	$('cat-custom-list').adopt(new Element('div').set('html',content).getFirst());
}
delLink=function(o){
	$(o).getParent('.custom').remove();
}
</script>